import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.IntFunction;

public class test1 {
    public static void main(String[] args) {
        ArrayList<String> arr = new ArrayList<>();
        Collections.addAll(arr,"张无忌,15","周芷若,14","赵敏,13","张强,20","张三丰,108","张翠山,48","张良,35","王二麻子,37");
//        Student[] array = arr.stream().map(Student::new).toArray(new IntFunction<Student[]>() {
//            @Override
//            public Student[] apply(int value) {
//                return new Student[value];
//            }
//        });
        Student[] array = arr.stream().map(Student::new).toArray(Student[]::new);
        System.out.println(Arrays.toString(array));
    }
}
